import React from "react"
import { Space, Button, notification, Input } from 'antd'
import { UpCircleOutlined, FileAddOutlined } from '@ant-design/icons'
import './index.less'

const TextArea = (porps) => {
    const { value, onChange, onOk, loading = false, disabled } = porps
    return <div className='AnsweringAi_textArea_box'>
        <div className='AnsweringAi_textArea_data'>
            <div className='AnsweringAi_textArea_item'>
                <div className='AnsweringAi_textArea'>
                    <textarea disabled={true} onKeyDown={(event) => {
                        if (event.key === 'Enter') {
                            // 阻止默认的回车换行行为
                            event.preventDefault();
                            // 在这里处理你的逻辑，例如添加新行或者提交表单
                            !loading && onOk()
                        }
                    }} style={{ border: 'none', outline: 'none' }} onInput={onChange} value={value} placeholder='给 ai助手 发送消息 ' className='AnsweringAi_textArea_liner1'></textarea>
                    <div className='AnsweringAi_textArea_liner2'></div>
                </div>
                <div className='AnsweringAi_btn'>
                    <Space style={{ marginLeft: 'auto' }} align="end">
                        <Button onClick={() => {
                            notification.warning({
                                message: '温馨提示',
                                description: '暂不支持文件上传',
                            });
                        }} icon={<FileAddOutlined></FileAddOutlined>}></Button>
                        <Button loading={loading} onClick={() => {
                            onOk()
                        }} disabled={true} icon={<UpCircleOutlined></UpCircleOutlined>} type='primary'></Button>
                        {/* <div className='AnsweringAi_btn_style1'>深度思考</div>
                        <div className='AnsweringAi_btn_style2'>联网搜索</div> */}
                    </Space>
                </div>
            </div>
        </div>
    </div>
}
export default TextArea